package xyz.xuminghai.javafx_learn.scene.shape;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.BorderPane;
import javafx.scene.paint.Color;
import javafx.scene.shape.Arc;
import javafx.scene.shape.ArcType;
import javafx.stage.Stage;

/**
 * 2023/8/11 21:09 星期五<br/>
 * Arc类表示 2D 圆弧对象，由中心点、起始角度（以度为单位）、角度范围（以度为单位的圆弧长度）和圆弧类型
 *
 * @author xuMingHai
 */
public class ArcApp extends Application {

    private final BorderPane root = new BorderPane();


    public static void main(String[] args) {
        Application.launch(args);
    }

    @Override
    public void init() {
        Arc arc = new Arc(0.0, 0.0, 80.0, 50.0, 30.0, 100.0);
        arc.setFill(null);
        arc.setType(ArcType.ROUND);
        arc.setStroke(Color.BLACK);
        root.setCenter(arc);
    }

    public void start(Stage primaryStage) {
        primaryStage.setTitle(getClass().getSimpleName());
        Scene scene = new Scene(root, 800, 600);
        primaryStage.setScene(scene);
        primaryStage.show();
    }

}
